/**
 * ��ҳjs
 * author daigq
 * date 20101211
 */


//在查询完成之前，将按钮设置为不可用

 function gotoPre()
{	
	//alert('pre');
	//var pageinfo = document.all("pageinfo").value;
	var pageinfo =$('#pageinfo').attr("value");
	var whichpage=$('#whichpage').attr("value");
	//alert(pageinfo);
	if(pageinfo<=0){
		//alert('�Ѿ��ǵ�һҳ��!');
		return;
	}else{
		//document.all("pageinfo").value = parseInt(pageinfo)-1;
		//document.all("whichpage").value = parseInt(document.all("whichpage").value)-1;
		$("#pageinfo").val(parseInt(pageinfo)-1); 
		
		$("#whichpage").val(parseInt(whichpage)-1); 
		//sendRequest();
		verify();
	}	
}


//ת���һҳ��
function gotoNext()
{
	//alert('next');
	var pageinfo =$('#pageinfo').attr("value");
	//var pageinfo = document.all("pageinfo").value;
	var pageNo=$('#pageNo').text();
	//alert(pageNo);
	//var pageNo = document.all("pageNo").innerText;
	var whichpage=$('#whichpage').attr("value");
	//alert("已点击"); alert("whichpage"+whichpage);
	if(pageNo<=parseInt(pageinfo)+1){
		//alert('�Ѿ������һҳ��!');
		return;
	}else{
		$("#pageinfo").val(parseInt(pageinfo)+1); 
		
		$("#whichpage").val(parseInt(whichpage)+1); 
		//alert(parseInt(whichpage)+1);
		//document.all("pageinfo").value = parseInt(pageinfo)+1;
		//document.all("whichpage").value = parseInt(document.all("whichpage").value)+1;
		//sendRequest();
		verify();
	}	
}

//ת����ҳ
function gotofirst()
{
	//alert('first');
	//document.all("pageinfo").value=0;
	//document.all("whichpage").value = 1;
		$("#pageinfo").val(0); 
		
		$("#whichpage").val(1); 
	verify();
}

//ת��βҳ
function gotoLast(){
	//alert(document.all("pageNo").innerText);
	var pageNo=$('#pageNo').text();
	//document.all("pageinfo").value = document.all("pageNo").innerText-1;
	//document.all("whichpage").value = document.all("pageNo").innerText;
		$("#pageinfo").val(pageNo-1); 
		
		$("#whichpage").val(pageNo); 
	verify();
}

//ת����һҳ
function gotoPageWhich(){
	//alert('which');
	//var whichpage = document.all("whichpage").value;
	//var pageNo = document.all("pageNo").innerText;
		var pageNo=$('#pageNo').text();

	var whichpage=$('#whichpage').attr("value");
	if(pageNo<parseInt(whichpage)){
		alert('�ѳ�����ҳ��Χ!');
		return;
	}else{
		$("#pageinfo").val(whichpage-1); 
		//document.all("pageinfo").value = document.all("whichpage").value-1;
		verify();
	}	
}
